<template>
  <div class="user">
    <div class="img-box">
      <img :src="photo ||`${require('@/../public/images/default-user.png')}`" alt="头像" />
    </div>
    <div class="autor my-text" :style="`${myStyle||'color:var(--text-black)'}`" v-if="name">{{ name }}</div>
    <div class="lv" v-if="lvl">Lv.{{ lvl }}</div>
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: ["photo","name","lvl","myStyle"],
};
</script>

<style lang="scss"  scoped>
.user {
  width: 100%;
  display: flex;
  align-items: center;
  > div {
    margin-right: 0.1rem;
  }
  .img-box {
    width: 0.34rem;
    height: 0.34rem;
    border-radius: 0.17rem;
    overflow: hidden;
  }
  .autor {
    font-size: 0.16rem;
    font-weight: bold;
    color: var(--text-black);
  }
  .lv {
    font-size: 0.12rem;
    line-height: 0.12rem;
    color: var(--text-lv);
  }
  .btn {
    width: 0.786rem;
    height: 0.32rem;
    border-radius: 0.16rem;
    margin-left: auto;
    margin-right: 0;
    text-align: center;
    line-height: 0.32rem;
    font-size: 0.12rem;
    background-color: var(--text-yellow);
    color: var(--white);
  }
}
</style>